#pragma once
#include "define.h"
#include "StateMain.h"
#include "Prefab.h"
#include "Vector2Int.h"
#include "Renderer.h"
#include <vector>

class StateMain;
class Object
{
public:
	Object (Prefab* prefab, Vector2Int position, float velY, StateMain* world);
	Object (std::vector<Vector2Int> block, Vector2Int position, float velY, int color, StateMain* world);
	~Object ();

	bool						Update (float deltaTime);
	bool						Move (Vector2Int distance);
	void						Rotate ();
	void						DropFast (bool isDroppingFast);
	void						Render ();

	bool						SplitObject (std::vector<Object*>& returnList);
	std::vector<Vector2Int>		GetBlock ();
	Vector2Int					GetPosition ();

private:
	Vector2Int					m_position;
	Prefab*						m_prefab;
	std::vector<Vector2Int>		m_block;
	StateMain*					m_world;
	bool						m_bIsDroppingFast;
	int							m_iColor;
	float						m_fPosY;
	float						m_fVelY;
	GLuint						m_boIds[2];

	void						ArrangeBlock ();
	void						SetModel ();
};
